<?php

namespace App\Entity;

use App\Enum\LogTypeEnum;
use App\Repository\SettingRepository;
use App\Utils\Helper\LogHelper;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity(repositoryClass=SettingRepository::class)
 * @ORM\HasLifecycleCallbacks()
 */
class Setting {
    /**
     * @ORM\Id()
     * @ORM\GeneratedValue()
     * @ORM\Column(type="integer")
     */
    private $id;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $seo_keys;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $seo_description;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $site_name;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $site_url;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $introduce;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $name;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $avatar;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $image;

    /**
     * @ORM\Column(type="string", length=500, nullable=true)
     */
    private $description;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $phone;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $email;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $address;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $social_qq;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $social_wechat;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $social_weibo;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $social_qzone;

    /**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $dashboard_type;

    /**
     * @ORM\Column(type="boolean", nullable=true, options={"default"="1"})
     */
    private $is_subscribe = 1;

    /**
     * @ORM\Column(type="boolean", nullable=true, options={"default"="0"})
     */
    private $is_comment = 0;

    /**
     * @ORM\Column(type="boolean", nullable=true, options={"default"="0"})
     */
    private $is_auto_pass_comment = 0;

    /**
     * @ORM\Column(type="boolean", nullable=true, options={"default"="1"})
     */
    private $is_reply = 1;

    /**
     * @ORM\Column(type="boolean", nullable=true, options={"default"="0"})
     */
    private $is_maintenance = 0;

    public $avatar_item;

    public $image_item;

    public function getId (): ?int {
        return $this->id;
    }

    public function getSeoKeys (): ?string {
        return $this->seo_keys;
    }

    public function setSeoKeys (?string $seo_keys): self {
        $this->seo_keys = $seo_keys;

        return $this;
    }

    public function getSeoDescription (): ?string {
        return $this->seo_description;
    }

    public function setSeoDescription (?string $seo_description): self {
        $this->seo_description = $seo_description;

        return $this;
    }

    public function getSiteName (): ?string {
        return $this->site_name;
    }

    public function setSiteName (?string $site_name): self {
        $this->site_name = $site_name;

        return $this;
    }

    public function getSiteUrl (): ?string {
        return $this->site_url;
    }

    public function setSiteUrl (?string $site_url): self {
        $this->site_url = $site_url;

        return $this;
    }

    public function getIntroduce (): ?string {
        return $this->introduce;
    }

    public function setIntroduce (?string $introduce): self {
        $this->introduce = $introduce;

        return $this;
    }

    public function getPhone (): ?string {
        return $this->phone;
    }

    public function setPhone (?string $phone): self {
        $this->phone = $phone;

        return $this;
    }

    public function getEmail (): ?string {
        return $this->email;
    }

    public function setEmail (?string $email): self {
        $this->email = $email;

        return $this;
    }

    public function getAddress (): ?string {
        return $this->address;
    }

    public function setAddress (?string $address): self {
        $this->address = $address;

        return $this;
    }

    public function getSocialQq (): ?string {
        return $this->social_qq;
    }

    public function setSocialQq (?string $social_qq): self {
        $this->social_qq = $social_qq;

        return $this;
    }

    public function getSocialWechat (): ?string {
        return $this->social_wechat;
    }

    public function setSocialWechat (?string $social_wechat): self {
        $this->social_wechat = $social_wechat;

        return $this;
    }

    public function getSocialWeibo (): ?string {
        return $this->social_weibo;
    }

    public function setSocialWeibo (?string $social_weibo): self {
        $this->social_weibo = $social_weibo;

        return $this;
    }

    public function getSocialQzone (): ?string {
        return $this->social_qzone;
    }

    public function setSocialQzone (?string $social_qzone): self {
        $this->social_qzone = $social_qzone;

        return $this;
    }

    public function getName (): ?string {
        return $this->name;
    }

    public function setName (?string $name): self {
        $this->name = $name;

        return $this;
    }

    public function getAvatar (): ?string {
        return $this->avatar;
    }

    public function setAvatar (?string $avatar): self {
        $this->avatar = $avatar;

        return $this;
    }

    public function getImage (): ?string {
        return $this->image;
    }

    public function setImage (?string $image): self {
        $this->image = $image;

        return $this;
    }

    public function getDescription (): ?string {
        return $this->description;
    }

    public function setDescription (?string $description): self {
        $this->description = $description;

        return $this;
    }

    public function getDashboardType (): ?string {
        return $this->dashboard_type;
    }

    public function setDashboardType (?string $dashboard_type): self {
        $this->dashboard_type = $dashboard_type;

        return $this;
    }

    public function getIsSubscribe (): ?bool {
        return $this->is_subscribe;
    }

    public function setIsSubscribe (?bool $is_subscribe): self {
        $this->is_subscribe = $is_subscribe;

        return $this;
    }

    public function getIsComment (): ?bool {
        return $this->is_comment;
    }

    public function setIsComment (?bool $is_comment): self {
        $this->is_comment = $is_comment;

        return $this;
    }

    public function getIsAutoPassComment (): ?bool {
        return $this->is_auto_pass_comment;
    }

    public function setIsAutoPassComment (?bool $is_auto_pass_comment): self {
        $this->is_auto_pass_comment = $is_auto_pass_comment;

        return $this;
    }

    public function getIsReply (): ?bool {
        return $this->is_reply;
    }

    public function setIsReply (?bool $is_reply): self {
        $this->is_reply = $is_reply;

        return $this;
    }

    public function getIsMaintenance (): ?bool {
        return $this->is_maintenance;
    }

    public function setIsMaintenance (?bool $is_maintenance): self {
        $this->is_maintenance = $is_maintenance;

        return $this;
    }

    /**
     * 更新之后 日志
     * @ORM\PostUpdate()
     */
    public function buildLogByUpdate () {
        $description = '站点名称:['.$this->getSiteName().'] 博主名称:['.$this->getName().']';
        LogHelper::buildLog(LogTypeEnum::TYPE_SETTING_UPDATE, $description, $this);
    }
}
